def fac(k):
    i = 2
    t = 1
    while i <=k:
        t *= i
        i += 1
    return  t
def sum (n):
    s = 0
    i = 1
    while i <= n:
        s = s + fac(i)
        i +=3
    return  s
print('3!+4!+5!...10!=',sum(50))
